package framework.view.components.graphics
{
import flash.display.Sprite;

import framework.view.components.IComponent;

public class FillRect extends Sprite implements IComponent
{
	public function FillRect()
	{
		super();
	}
	
	public var color:uint = 0xFFFFFF;
	
	public var ellipseWidth:Number = 0;
	
	public var ellipseHeight:Number = 0;
	
	public var colorAlpha:Number = 1;
	
	private var w:Number = 0;
	
	override public function get width():Number
	{
		return w;
	}
	
	override public function set width(value:Number):void
	{
		w = value;
	}
	
	private var h:Number = 0;
	
	override public function get height():Number
	{
		return h;
	}
	
	override public function set height(value:Number):void
	{
		h = value;
	}
	
	public function commitProperty():void
	{
		this.graphics.clear();
		this.graphics.beginFill(color, colorAlpha);
		this.graphics.drawRoundRect(0, 0, w, h, ellipseWidth, ellipseHeight);
		this.graphics.endFill();
	}
	
	public function dispose():void
	{
		this.graphics.clear();
	}
}
}